package com.example.heathy_me.reportDetail.utils;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.heathy_me.R;

public class ReportContentFragment extends Fragment {

    private View view;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.report_content_frag, container, false);
        return view;
    }

    public void refresh(String reportTitle, String reportContent) {
        View visibilityLayout = view.findViewById(R.id.visibility_layout);
        visibilityLayout.setVisibility(View.VISIBLE);
        TextView reportTitleText = (TextView) view.findViewById (R.id.report_title);
        TextView reportContentText = (TextView) view.findViewById(R.id.report_content);
        reportTitleText.setText(reportTitle); // 刷新标题
        reportContentText.setText(reportContent); // 刷新内容
    }

}

